package vn.com.servicedirectory.repository.custom;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import vn.com.servicedirectory.model.Programme;

public interface ProgrammeRepositoryCustom {
	@Query("SELECT p From Programme p WHERE active=?1")
	Page<Programme> findByActive(boolean active,Pageable pageable);

	@Query("select p From Programme p where substring(p.name,1,1) between ?1 and ?2 and (p.active=true or p.active=?3)")
	Page<Programme> findByName(char begin, char end, boolean active,Pageable pageable);
}
